<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="http://webservices.groove.net/Groove/2.0/Messages/" xmlns:e="http://webservices.groove.net/Groove/2.0/Events/" xmlns:g="http://webservices.groove.net/Groove/2.0/Core/" elementFormDefault="qualified" targetNamespace="http://webservices.groove.net/Groove/2.0/Messages/" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:import schemaLocation="./Core.xsd" namespace="http://webservices.groove.net/Groove/2.0/Core/" />
  <xs:import schemaLocation="./Events.xsd" namespace="http://webservices.groove.net/Groove/2.0/Events/" />
  <xs:import schemaLocation="./Contacts.xsd" namespace="http://webservices.groove.net/Groove/2.0/Contacts/" />
  <xs:complexType name="MessageContact">
    <xs:sequence>
      <xs:element name="URI" type="xs:anyURI" />
      <xs:element minOccurs="0" name="Name" type="xs:string" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="MessageContactList">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="MessageContact" type="tns:MessageContact" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="MessageList">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="Message" type="tns:Message" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Message">
    <xs:sequence>
      <xs:element name="MessageHeader" type="tns:MessageHeader" />
      <xs:element minOccurs="0" name="MessageContent" type="tns:MessageContent" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="MessageHeader">
    <xs:sequence>
      <xs:element name="ID" type="xs:string" />
      <xs:element name="URI" type="xs:anyURI" />
      <xs:element name="Category" type="tns:MessageCategory" />
      <xs:element name="Sender" type="tns:MessageContact" />
      <xs:element name="Recipients" type="tns:MessageContactList" />
      <xs:element name="HasVoiceMemo" type="xs:boolean" />
      <xs:element name="HasAttachments" type="xs:boolean" />
      <xs:element name="Created" type="xs:dateTime" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="MessageContent">
    <xs:sequence>
      <xs:element name="Body" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" name="VoiceMemo" type="tns:MessageAttachment" />
      <xs:element minOccurs="0" maxOccurs="1" name="AttachmentList" type="tns:MessageAttachmentList" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="MessageAttachment">
    <xs:sequence>
      <xs:element name="DisplayName" type="xs:string" />
      <xs:element name="Type" type="tns:AttachmentType" />
      <xs:element name="Size" type="xs:int" />
      <xs:element minOccurs="0" maxOccurs="1" name="Content" type="xs:base64Binary" />
      <xs:element minOccurs="0" maxOccurs="1" name="AttachmentFileURI" type="xs:anyURI" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="MessageAttachmentList">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="MessageAttachment" type="tns:MessageAttachment" />
    </xs:sequence>
  </xs:complexType>
  <xs:simpleType name="MessageCategory">
    <xs:restriction base="xs:string">
      <xs:enumeration value="New" />
      <xs:enumeration value="Opened" />
      <xs:enumeration value="Sent" />
      <xs:enumeration value="Inbox" />
      <xs:enumeration value="All" />
      <xs:enumeration value="Unknown" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="AttachmentType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Voice" />
      <xs:enumeration value="File" />
      <xs:enumeration value="Unknown" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="Create">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="MessageHeader" type="tns:MessageHeader" />
        <xs:element name="MessageContent" type="tns:MessageContent" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="CreateResponse">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="CreateResult" type="xs:anyURI" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="CreateReply">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="ReplyToAll" type="xs:boolean" />
        <xs:element name="IncludeOriginalMessageContent" type="xs:boolean" />
        <xs:element minOccurs="0" maxOccurs="1" name="AdditionalHeaderData" type="tns:MessageHeader" />
        <xs:element minOccurs="0" maxOccurs="1" name="AdditionalContent" type="tns:MessageContent" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="CreateReplyResponse">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="CreateReplyResult" type="xs:anyURI" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="CreateForward">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="1" name="AdditionalHeaderData" type="tns:MessageHeader" />
        <xs:element minOccurs="0" maxOccurs="1" name="AdditionalContent" type="tns:MessageContent" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="CreateForwardResponse">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="CreateForwardResult" type="xs:anyURI" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Read">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="1" name="IncludeContent" type="xs:boolean" />
        <xs:element minOccurs="0" maxOccurs="1" name="IncludeAttachments" type="xs:boolean" />
        <xs:element minOccurs="0" maxOccurs="1" name="MarkMessagesOpened" type="xs:boolean" />
        <xs:element minOccurs="0" maxOccurs="1" name="Category" type="tns:MessageCategory" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="ReadResponse">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="ReadResult" type="tns:MessageList" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="ReadMessage">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="1" name="IncludeContent" type="xs:boolean" />
        <xs:element minOccurs="0" maxOccurs="1" name="IncludeAttachments" type="xs:boolean" />
        <xs:element minOccurs="0" maxOccurs="1" name="MarkMessageOpened" type="xs:boolean" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="ReadMessageResponse">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="ReadMessageResult" type="tns:Message" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Delete">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="MessageURIList" type="g:URIList" />
        <xs:element minOccurs="0" maxOccurs="1" name="OnAllEndpoints" type="xs:boolean" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="DeleteResponse">
    <xs:complexType />
  </xs:element>
  <xs:complexType name="MessageReceivedEventData">
    <xs:complexContent mixed="false">
      <xs:restriction base="e:EventData">
        <xs:sequence>
          <xs:element name="MessageHeader" type="tns:MessageHeader" />
        </xs:sequence>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MessageOpenedEventData">
    <xs:complexContent mixed="false">
      <xs:restriction base="e:EventData">
        <xs:sequence>
          <xs:element name="MessageHeader" type="tns:MessageHeader" />
        </xs:sequence>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MessageDeleteEventData">
    <xs:complexContent mixed="false">
      <xs:restriction base="e:EventData">
        <xs:sequence>
          <xs:element name="MessageURI" type="xs:anyURI" />
        </xs:sequence>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MessageSentEventData">
    <xs:complexContent mixed="false">
      <xs:restriction base="e:EventData">
        <xs:sequence>
          <xs:element name="MessageHeader" type="tns:MessageHeader" />
          <xs:element name="Recipient" type="tns:MessageContact" />
        </xs:sequence>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>